package cn.base.demo3;

public class Code13 {
    public static void main(String[] args) {
        getSxh(125);
    }

    public static void getSxh(int num) {
        if (num > 999 || num < 100) {
            System.out.println(num + "不是水仙花数");
            return;
        }
        int g = num % 10;
        int s = num / 10 % 10;
        int b = num / 100;
        if (num == g * g * g + s * s * s + b * b * b) {
            System.out.println(num + "是水仙花数");
        } else {
            System.out.println(num + "不是水仙花数");
        }
    }
}
